package model.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@SuppressWarnings("serial")
@Embeddable
public class SalesDetailsId implements Serializable{

	private int salesId;
	private int productId;

	public SalesDetailsId() {
	}

	public SalesDetailsId(int salesId, int productId) {
		this.salesId = salesId;
		this.productId = productId;
	}

	@Column(name = "SalesID", nullable = false)
	public int getSalesId() {
		return this.salesId;
	}

	public void setSalesId(int salesId) {
		this.salesId = salesId;
	}

	@Column(name = "ProductID", nullable = false)
	public int getProductId() {
		return this.productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof SalesDetailsId))
			return false;
		SalesDetailsId castOther = (SalesDetailsId) other;

		return (this.getSalesId() == castOther.getSalesId())
				&& (this.getProductId() == castOther.getProductId());
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + this.getSalesId();
		result = 37 * result + this.getProductId();
		return result;
	}

}
